<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.springframework.org/schema/data/jaxb">
<head>
    <meta charset="UTF-8">
    <title>代码生成器</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>

    <!--Bootstrap-->
    <link th:href="@{/bootstrap/css/bootstrap.min.css}" rel="stylesheet" />
    <link th:href="@{/validate/bootstrapValidator.css}" rel="stylesheet" />

    <script th:src="@{/jquery.js}"></script>
    <script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
    <script th:src="@{/validate/bootstrapValidator.min.js}"></script>
    <script th:src="@{/validate/zh_CN.js}"></script>

</head>
<body>

<div class="jumbotron text-center" style="margin-bottom:0">
    <h1>代码生成器</h1>
</div>

<div class="container" style="margin-top: 20px" >
    <div class="row">
        <form class="form-horizontal" role="form" id="save_form"  method="post"  th:action="@{/main}" >
            <div class="form-group">
                <label for="url" class="col-sm-2 control-label">数据库链接地址</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="url" name="url" placeholder="请输入数据库链接地址" data-bv-notempty="true"/>
                </div>
            </div>

            <div class="form-group">
                <label for="username" class="col-sm-2 control-label">账号</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="username" name="username" placeholder="请输入数据库账号" data-bv-notempty="true"/>
                </div>
            </div>


            <div class="form-group">
                <label for="password" class="col-sm-2 control-label">数据库密码</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="password" name="password" placeholder="请输入数据库密码" data-bv-notempty="true"/>
                </div>
            </div>


            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary btn-lg btn-block" id="sub_btn" >查看数据</button>
                </div>
            </div>

        </form>
    </div>
</div>
<script>
$(function () {

    $("#save_form").bootstrapValidator({
        message: '必须填写',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        live: 'disabled',
        fields: {
            url: {
                validators: {
                    notEmpty: {
                        message: '请数据库链接地址:'
                    }
                }
            },
            username: {
                validators: {
                    notEmpty: {
                        message: '请输入数据库账号'
                    }
                }
            },
            password: {
                validators: {
                    notEmpty: {
                        message: '请输入数据库密码'
                    }
                }
            }
        }
    });
})




</script>

</body>
</html>